<template>
    <div>
          <h1>websocket 聊天室演示</h1>
          用户名：<input type="text" v-model="name">
           <button type="button" @click="login">登录</button>
    </div>

</template>

<script>
    export default {
        name: "TestLogin",
        data(){
           return{
               name:""
           }
        },
        methods:{
             login(){
                localStorage.setItem("name",this.name);
                this.$router.push("/testChat");

             }
        }
    }
</script>

<style scoped>

</style>
